<html>
<head><meta charset="utf-8"><title>Stack clash protection · t-compiler/wg-llvm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/index.html">t-compiler/wg-llvm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Stack.20clash.20protection.html">Stack clash protection</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="178180995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Stack%20clash%20protection/near/178180995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Stack.20clash.20protection.html#178180995">(Oct 15 2019 at 10:54)</a>:</h4>
<p><a href="https://lists.llvm.org/pipermail/llvm-dev/2019-October/135786.html" target="_blank" title="https://lists.llvm.org/pipermail/llvm-dev/2019-October/135786.html">https://lists.llvm.org/pipermail/llvm-dev/2019-October/135786.html</a><br>
Isn't this something Rust already does? Why do they need to touch codegen to make this happen in clang?</p>



<a name="178181222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Stack%20clash%20protection/near/178181222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Stack.20clash.20protection.html#178181222">(Oct 15 2019 at 10:58)</a>:</h4>
<p>Looking at the description of the linked patch, it seems to use the same mechanism we use (probe-stack), just extended to use an inlined code sequence instead of a function call. I don't know why this is necessary, perhaps they can't assume that such a function is available? (e.g. if using clang with libgcc)</p>



<a name="178185484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Stack%20clash%20protection/near/178185484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Stack.20clash.20protection.html#178185484">(Oct 15 2019 at 12:00)</a>:</h4>
<p>Reading the patch the author wants to avoid probing where unnecessary (i.e. where the otherwise generated code would probe by itself?)</p>



<a name="178434092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Stack%20clash%20protection/near/178434092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Stack.20clash.20protection.html#178434092">(Oct 18 2019 at 00:31)</a>:</h4>
<p>I think Rust also only does this for arm and x86, but Serge eventually wants to reach at least all arches that Fedora uses</p>



<a name="178537495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Stack%20clash%20protection/near/178537495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Stack.20clash.20protection.html#178537495">(Oct 19 2019 at 09:18)</a>:</h4>
<p>if they do, can Rust benefit from that as well? would be good to have more arches covered :D</p>



<a name="178537732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187780-t-compiler/wg-llvm/topic/Stack%20clash%20protection/near/178537732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/187780-t-compiler/wg-llvm/topic/Stack.20clash.20protection.html#178537732">(Oct 19 2019 at 09:24)</a>:</h4>
<p>Presumably, since AFAIK the limiting factor for rustc's stack probing is porting the assembly code that does the probing and backend support for inserting the probing in functions, both of which they would also have to solve for Clang.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>